<?php $this->display('header') ?>
<link href="{$_W['siteroot']}../addons/{MOD_ADD}/static/admin/H/css/plugins/iCheck/custom.css" rel="stylesheet">
<!-- iCheck -->
<script src="{$_W['siteroot']}../addons/{MOD_ADD}/static/admin/H/js/plugins/iCheck/icheck.min.js"></script>
</head>
<body>
<div id="wrapper">
    <!--左侧导航开始-->
    <?php $this->display('menu') ?>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <?php $this->display('header_top') ?>
        <div class="ibox-content">
            <form class="cmxform form-horizontal tasi-form" id="form_name" name="form_name">
                <div class="form-group row">
                    <label for="firstname" class="col-sm-2 control-label">上级栏目名称</label>
                    <div class="col-sm-6">
                        <select class="form-control m-bot15" name="pid">
                            <option value="">请选择</option>
                            <option value="0">顶级</option>
                            {loop $level $vo}
                            <option value="{$vo['id']}">{$vo['pname']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="name" class="col-sm-2 control-label">菜单名称</label>
                    <div class="col-sm-6">
                        <input type="text" id="name" name="name" placeholder="例如 系统管理" class="form-control">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="mca" class="col-sm-2 control-label">链接</label>
                    <div class="col-sm-6">
                        <input type="text" id="mca" name="mca" placeholder="模块/控制器/方法 例如 menu/menu_add"  class="form-control">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="icon" class="col-sm-2 control-label">图标</label>
                    <div class="col-sm-6">
                        <input type="text" id="icon" name="icon" placeholder="font-awesome图标 输入 fa 后边的即可 例如：fa-plus"  class="form-control">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="order_num" class="col-sm-2 control-label">排序</label>
                    <div class="col-sm-6">
                        <input type="text" id="order_num" name="order_num" placeholder="请输入0~100的数字" onkeyup="value=value.replace(/[^0-9]/g,'')" class="form-control"/>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="type" class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-6">
                        <div class="radio i-checks">
                            <label class="test" ><input type="radio" value="1" name="status"  class="test" checked class="required"> <i></i> 正常</label>
                            <label class="test" ><input type="radio" value="2" name="status"  class="test"  class="required"> <i></i> 关闭</label>
                        </div>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group row">
                    <div class="col-sm-2 col-sm-offset-2"></div>
                    <div class="col-sm-4 col-sm-offset-2">
                        <input type="hidden" value="{php echo gWebUrl('menus/add')}" id="url_class" name="url_class">
                        <button class="ladda-button btn btn-info" data-style="slide-right" id="form_submit">提交
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<!--表单验证-->
<script src="https://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
<script src="https://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
<script>
    $('.i-checks').iCheck({
        checkboxClass: 'icheckbox_square-green',
        radioClass: 'iradio_square-green'
    });
    $.validator.setDefaults({
        submitHandler: function () {
            if (!$(this).hasClass('disabled')) {
                $(this).addClass('disabled');
                //验证
                postFormData('form_name');
                setTimeout("$('#form_submit').removeClass('disabled')", 2000);
                return false;
            }
        }
    });
    $().ready(function () {
        $("#form_name").validate({
            rules: {
                name: "required",
                mca: "required",
                order_num: "required",
            },
            messages: {
            }
        })
    });
</script>
<?php $this->display('foot') ?>